#include <stdio.h>
#include <stdlib.h>
#include "../Includes/Driver.h"
#include "../Includes/Rendering.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include <unistd.h>

/// <summary>
/// Locals
/// </summary>
FT_Library library;

/// <summary>
/// TODO
/// </summary>
int FONTInit(void)
{
	/* Font Startup */
	if (FT_Init_FreeType(&library) != 0)
		return -1;
	return 0;
}

/// <summary>
/// Resize the scale of
/// the active Face object.
/// </summary>
int FONTSetFaceSize(void* pface, int width, int height) {
	
	FT_Face* face;
	if ((face = (FT_Face*)pface) == NULL)
		return -1;

	/* Set the Face size */
	if (FT_Set_Pixel_Sizes(*face, width, height) != 0)
		return -2;

	return 0;
}

/// <summary>
/// TODO
/// </summary>
int FONTExit(void)
{
	/* Font Shutdown */
	if (FT_Done_FreeType(library) != 0)
		return -1;
	return 0;
}
